<div id="header" class="inner-tabs-panel">
    <div class="inner-content">


        <div class="panel">

            <div class="panel-heading">
                <div class="panel-title">
                    Header - <code class="help">Slug : #home</code>
                </div>
            </div>

            <div class="panel-body wo-flag"> 
                <div class="form-group">
                    <div class="control-button">
                        <div class="slider">
                            <input type="checkbox" id="enable-header" class="toggle-settings"  name="theme_options[header][enable]" value="1" <?php echo  (isset($aHeader['enable']) && !empty ($aHeader['enable']) ) ? 'checked' : ''; ?> >
                            <label for="enable-header">Enable Header</label>
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="form-label">Header Type</label>
                    <div class="controls">
                        <select class="select_header_type" name="theme_options[header][type]">
                            <?php 
                                $headerChecked = isset($aHeader['type']) ? $aHeader['type'] : 'slider';
                                $headerType = array('video'=>'Youtube Backgorund', 'slider'=>'Slider Backgorund', 'image_fixed'=>'Image Static');
                                
                                foreach ($headerType as $k => $val) :   
                                $checked = $k == $headerChecked ? 'selected' : '';
                            ?>
                            <option <?php echo $checked ?> value="<?php echo $k ?>"><?php echo $val ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>

                <div class="form-group header_slider">
                    <label class="form-label">Choose A Slider</label>
                    <?php if (!is_plugin_active('tunna-slider/tunna-slider.php')) :echo '<span class="help">Please active the <code>Tunna Slider</code> plugin</span>' ?>
                    <?php 
                         else : 
                        ?>
                        <div class="controls">
                           <?php
                        $aTunnaSlider = $this->wo_get_custom_post_content('tunna_slider');

                        if ( empty($aTunnaSlider) )
                        {
                            ?>

                            <p> You haven't had any slider yet. Please go to 
                                <a  class="help" target="_blank" href="<?php echo admin_url('edit.php'); ?>?post_type=tunna_slider"> and create some</a>
                            </p>

                        <?php
                        }else
                        {
                        ?>
                        <select name="theme_options[header][tunna_slider]" id="">
                            <?php
                            foreach ( $aTunnaSlider as $k => $getId ) : setup_postdata($getId);
                                if (isset($aHeader['tunna_slider']) && !empty($aHeader['tunna_slider']) && $aHeader['tunna_slider'] == $getId->ID )
                                {
                                    $selected = 'selected';
                                }else{
                                    if ($k == 0)
                                    {
                                        $selected = 'selected';
                                    }else{
                                        $selected = '';
                                    }
                                }
                                ?>
                                <option value="<?php echo $getId->ID; ?>" <?php echo $selected ?> ><?php echo $getId->post_title; ?></option>
                            <?php
                            $selected="";
                            endforeach;wp_reset_postdata();
                           
                            ?>
                        </select>
                        <?php  } ?>
                        </div>
                        <?php 

                         endif;
                        ?> 
                </div>

                <div class="form-group header_youtube">
                    <label class="form-label">Enter Youtube Link</label>
                    <div class="controls">
                        <input type="text" class="form-control" name="theme_options[header][youtube_link]" value="<?php  echo  isset($aHeader['youtube_link']) ? esc_url($aHeader['youtube_link']) : ""; ?>">
                    </div>
                </div>

                <div class="form-group image-fixed">
                    <?php $imageFixed = isset($aHeader['image_fixed']) && !empty($aHeader['image_fixed']) ? wp_get_attachment_url($aHeader['image_fixed']) : WO_ADMIN_IMG  . 'no-img.jpg'; ?>
                    <div class="image-wrap">
                        <span><img src="<?php echo $imageFixed; ?>"  width="350"></span>
                    </div>
                    <br>
                    <a class="btn btn-white upload-img blog-img" data-insertlink=".wo-insert-link" data-append=".image-wrap">Get image</a>
                    <input class="insertlink" type="hidden" value="<?php echo  isset($aHeader['image_fixed']) ? $aHeader['image_fixed'] : ""; ?>" name="theme_options[header][image_fixed]">
                </div>

            </div> <!--/end section1 of ourservices -->

            <div class="panel-body header-settings">
                <h4>Header Settings</h4>
                <div class="form-group">
                    <label class="form-label">Title</label>
                    <div class="form-control">
                        <input type="text" class="form-control" name="theme_options[header][title]" value="<?php  echo isset($aHeader['title']) ? stripslashes($aHeader['title']) : ""; ?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">Highlight</label>
                    <div class="form-control">
                        <input type="text" class="form-control" name="theme_options[header][highlight_text]" value="<?php  echo isset($aHeader['highlight_text']) ? stripslashes($aHeader['highlight_text']) : ""; ?>">
                    </div>
                    <br>
                
                    <label class="form-label">Color</label>
                    <div class="form-control">
                        <?php 
                           $highline = isset($aHeader['highlight']) ? ltrim($aHeader['highlight'])  : "blue";
                            $aSettings = array("red", "green", "blue", "orange", "purple", "yellow");  
                            ?>
                            <ul class="skin-color qva-design">
                                 <?php 
                                    foreach ($aSettings as $v) :
                                        $active = ($v == $highline) ? " skin-active" : '';
                                        ?>
                                        <li class="<?php echo $v .  $active; ?>" data-key="<?php echo $v ?>"><a href="#"><i class="fa fa-check"></i></a></li>
                                        <?php 
                                    endforeach;
                                ?>
                            </ul>
                            <input class="hidden" name="theme_options[header][highlight]" value="<?php echo $highline ?>">
                    </div>
                    <br>

                    <label class="form-label">Pattern</label>
                    <div class="form-control">
                        <?php 
                        $pattern = isset($aHeader['pattern']) ? $aHeader['pattern']  : "pattern_2";
                        $aSettings = array("pattern_1", "pattern_2", "pattern_3", "pattern_4", "pattern_5", "pattern_6"); 
                        ?>
                        <ul class="skin-color qva-design header-patterns">
                            <?php 
                                foreach ($aSettings as $v) :
                                    // $checked = "";
                                    $checked = $v == $pattern ? ' skin-active' : '';
                                    ?>
                                     <li class="<?php echo $v . $checked; ?>" data-key="<?php echo $v ?>"><a href="#"><i class="fa fa-check"></i></a></li>
                                    <?php 
                                endforeach;
                            ?>
                         </ul>
                         <input class="hidden" name="theme_options[header][pattern]" value="<?php echo $pattern ?>">
                    </div>

                    <label class="form-label">Overlay</label>
                    <div class="form-control">

                        <?php 
                           $overlay = isset($aHeader['overlay']) ? ltrim($aHeader['overlay'])  : "blue";
                            $aSettings = array("red", "green", "blue", "orange", "purple", "transparent");  
                            ?>
                            <ul class="skin-color qva-design">
                                 <?php 
                                    foreach ($aSettings as $v) :
                                        $active = ($v == $overlay) ? " skin-active" : '';
                                        ?>
                                        <li class="<?php echo $v .  $active; ?>" data-key="<?php echo $v ?>"><a href="#"><i class="fa fa-check"></i></a></li>
                                        <?php 
                                    endforeach;
                                ?>
                            </ul>
                            <input class="hidden" name="theme_options[header][overlay]" value="<?php echo $overlay ?>">
                   
                    </div>
                 
                </div>
                <div class="form-group">
                    <label class="form-label">Description</label>
                    <div class="form-control">
                        <textarea class="form-control"  name="theme_options[header][description]"><?php  echo isset($aHeader['description']) ? stripslashes($aHeader['description']) : ""; ?></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">Link</label>
                    <div class="form-control">
                        <input type="text" class="form-control" placeholder="Link Title" name="theme_options[header][link_title]" value="<?php  echo isset($aHeader['link_title']) ? stripslashes($aHeader['link_title']) : ""; ?>">
                        <br>
                        <code class="help">it scroll down to the equivalent section, please enter the Slug of this section</code>
                    </div>
                    <br>
                    <div class="form-control">
                        <input type="text" class="form-control" placeholder="Link" name="theme_options[header][link]" value="<?php  echo isset($aHeader['link']) ? stripslashes($aHeader['link']) : ""; ?>">
                    </div>
                </div>
            </div>
            
        </div><!-- END Panel -->
    </div>
</div>